package org.example.web;

import org.example.model.Result;
import org.example.service.FAQService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController //功能是将类声明为一个控制器，并使其中的方法可以直接响应HTTP请求
@RequestMapping("/userApi/faqCtl")
public class FAQController {

    @Autowired //自动装配
    private FAQService faqService;

    @RequestMapping("/faq") //映射到/userApi/contact/faq的HTTP请求
    public Result getFAQ() {
        return new Result(200, "success", faqService.getFAQ());
    }


}
